<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
 </tr>
 </tbody>
</table>
</div>
<body bgcolor="#ffffff">
<table width="100%">
  <tr>
    <td width="30%" align="left" valign="center">
      <a href="https://github.com/open-source-parsers/jsoncpp">
      JsonCpp project page
      </a>
    </td>
    <td width="20%" align="center" valign="center">
      <a href="hierarchy.html">
        Classes
      </a>
    </td>
    <td width="20%" align="center" valign="center">
      <a href="namespace_json.html">
        Namespace
      </a>
    </td>
    <td width="30%" align="right" valign="center">
      <a href="http://open-source-parsers.github.io/jsoncpp-docs/doxygen/">JsonCpp home page</a>
    </td>
  </tr>
</table>
<hr>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_json_1_1_styled_stream_writer.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_json_1_1_styled_stream_writer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Json::StyledStreamWriter Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Writes a <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> in <a href="http://www.json.org">JSON</a> format in a human friendly way, to a stream rather than to a string.  
 <a href="class_json_1_1_styled_stream_writer.html#details">More...</a></p>

<p><code>#include &lt;json/writer.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae70975badffb647580963146de0b1cfc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_styled_stream_writer.html#ae70975badffb647580963146de0b1cfc">StyledStreamWriter</a> (std::string indentation=&quot;\)</td></tr>
<tr class="separator:ae70975badffb647580963146de0b1cfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17444a59f617970279714e97b0ddfa46"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_styled_stream_writer.html#a17444a59f617970279714e97b0ddfa46">~StyledStreamWriter</a> ()</td></tr>
<tr class="separator:a17444a59f617970279714e97b0ddfa46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07807741c6c43ecd35885a87234d0805"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_styled_stream_writer.html#a07807741c6c43ecd35885a87234d0805">write</a> (std::ostream &amp;out, const <a class="el" href="class_json_1_1_value.html">Value</a> &amp;root)</td></tr>
<tr class="memdesc:a07807741c6c43ecd35885a87234d0805"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize a <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> in <a href="http://www.json.org">JSON</a> format.  <a href="#a07807741c6c43ecd35885a87234d0805">More...</a><br /></td></tr>
<tr class="separator:a07807741c6c43ecd35885a87234d0805"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Writes a <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> in <a href="http://www.json.org">JSON</a> format in a human friendly way, to a stream rather than to a string. </p>
<p>The rules for line break and indent are as follow:</p><ul>
<li>Object value:<ul>
<li>if empty then print {} without indent and line break</li>
<li>if not empty the print '{', line break &amp; indent, print one value per line and then unindent and line break and print '}'.</li>
</ul>
</li>
<li>Array value:<ul>
<li>if empty then print [] without indent and line break</li>
<li>if the array contains no object value, empty array or some other value types, and all the values fit on one lines, then print the array on a single line.</li>
<li>otherwise, it the values do not fit on one line, or the array contains object or non empty array, then print one value per line.</li>
</ul>
</li>
</ul>
<p>If the <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> have comments then they are outputed according to their <a class="el" href="namespace_json.html#a4fc417c23905b2ae9e2c47d197a45351">CommentPlacement</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_json_1_1_reader.html" title="Unserialize a JSON document into a Value. ">Reader</a>, <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a>, <a class="el" href="class_json_1_1_value.html#a29f3a30f7e5d3af6f38d57999bf5b480">Value::setComment()</a> </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000010">Deprecated:</a></b></dt><dd>Use <a class="el" href="class_json_1_1_stream_writer_builder.html" title="Build a StreamWriter implementation. ">StreamWriterBuilder</a>. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae70975badffb647580963146de0b1cfc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae70975badffb647580963146de0b1cfc">&#9670;&nbsp;</a></span>StyledStreamWriter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Json::StyledStreamWriter::StyledStreamWriter </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>indentation</em> = <code>&quot;\t&quot;</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">indentation</td><td>Each level will be indented by this amount extra. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a17444a59f617970279714e97b0ddfa46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17444a59f617970279714e97b0ddfa46">&#9670;&nbsp;</a></span>~StyledStreamWriter()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Json::StyledStreamWriter::~StyledStreamWriter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a07807741c6c43ecd35885a87234d0805"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07807741c6c43ecd35885a87234d0805">&#9670;&nbsp;</a></span>write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Json::StyledStreamWriter::write </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_json_1_1_value.html">Value</a> &amp;&#160;</td>
          <td class="paramname"><em>root</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Serialize a <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> in <a href="http://www.json.org">JSON</a> format. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">out</td><td>Stream to write to. (Can be ostringstream, e.g.) </td></tr>
    <tr><td class="paramname">root</td><td><a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a> to serialize. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>There is no point in deriving from <a class="el" href="class_json_1_1_writer.html" title="Abstract class for writers. ">Writer</a>, since <a class="el" href="class_json_1_1_styled_stream_writer.html#a07807741c6c43ecd35885a87234d0805" title="Serialize a Value in JSON format. ">write()</a> should not return a value. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/json/<a class="el" href="writer_8h.html">writer.h</a></li>
<li>src/lib_json/<a class="el" href="json__writer_8cpp.html">json_writer.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_json.html">Json</a></li><li class="navelem"><a class="el" href="class_json_1_1_styled_stream_writer.html">StyledStreamWriter</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
